| Module | WebmasterTools::Sitemappable::ClassMethods |
| In: |
lib/webmaster_tools/sitemappable.rb
|
| sitemap_changefreq | [RW] | |
| sitemap_host | [RW] | |
| sitemap_index_path | [RW] | |
| sitemap_lastmod_field | [RW] | |
| sitemap_path | [RW] | |
| sitemap_priority | [RW] | |
| sitemap_protocol | [RW] |
Options
always hourly daily weekly monthly yearly never
# File lib/webmaster_tools/sitemappable.rb, line 30
30: def sitemappable(options = {})
31: WebmasterTools::Sitemaps.model_sitemaps << name.downcase.to_sym unless WebmasterTools::Sitemaps.model_sitemaps.include?(name.downcase.to_sym)
32:
33: class << self
34: attr_accessor :sitemap_changefreq, :sitemap_priority, :sitemap_path, :sitemap_lastmod_field, :sitemap_host, :sitemap_protocol, :sitemap_index_path
35: end
36:
37: @sitemap_path = options[:path] || "/#{name.underscore.pluralize}"
38: @sitemap_index_path = options[:index_path] || "/#{name.underscore.pluralize}_sitemap.xml"
39: @sitemap_changefreq = options[:changefreq] || WebmasterTools::Sitemaps::Defaults.changefreq || "weekly"
40: @sitemap_priority = options[:priority] || WebmasterTools::Sitemaps::Defaults.priority || "0.5"
41: @sitemap_lastmod_field = options[:lastmod_field] || WebmasterTools::Sitemaps::Defaults.lastmod_field || :updated_at
42: @sitemap_host = options[:host] || WebmasterTools::Sitemaps::Defaults.host || "localhost:3000"
43: @sitemap_protocol = options[:protocol] || WebmasterTools::Sitemaps::Defaults.protocol || "http://"
44:
45: include Sitemappable::InstanceMethods
46: extend Sitemappable::SingletonMethods
47: end
This makes it easy to check if the class has the sitemappable mixin
# File lib/webmaster_tools/sitemappable.rb, line 50
50: def sitemappable?
51: true
52: end